import 'package:seedfour/generated/json/base/json_convert_content.dart';
import 'package:seedfour/app/models/case_all_entity.dart';
import 'package:seedfour/app/models/case_list_entity.dart';


CaseAllEntity $CaseAllEntityFromJson(Map<String, dynamic> json) {
  final CaseAllEntity caseAllEntity = CaseAllEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    caseAllEntity.total = total;
  }
  final List<CaseInfo>? all = (json['all'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<CaseInfo>(e) as CaseInfo).toList();
  if (all != null) {
    caseAllEntity.all = all;
  }
  return caseAllEntity;
}

Map<String, dynamic> $CaseAllEntityToJson(CaseAllEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['all'] = entity.all?.map((v) => v.toJson()).toList();
  return data;
}

extension CaseAllEntityExtension on CaseAllEntity {
  CaseAllEntity copyWith({
    int? total,
    List<CaseInfo>? all,
  }) {
    return CaseAllEntity()
      ..total = total ?? this.total
      ..all = all ?? this.all;
  }
}